package com.common.transformer;

import com.applicationLayer.formbean.AdminForm;
import com.common.entity.Admin;

public class AdminTransformer {
	
	
	/*************************************
	 * TRANSFORMER Admin => AdminForm
	 * @return AdminForm
	 **************************************/
	public static AdminForm Admin_TO_AdminForm(Admin admin){
		AdminForm adminForm=new AdminForm();
		adminForm.setId(admin.getId());
		adminForm.setFirstName(admin.getPrenom());
		adminForm.setName(admin.getNom());
		adminForm.setLogin(admin.getLogin());
		adminForm.setLastConnexion(admin.getLastConnexion());
		adminForm.setPassword(admin.getPassword());
		return adminForm;
	}
	
	/*******************************************
	 * transform Admin->Form                   *
	 * ****************************************/
	
	public static Admin AdminForm_To_Admin(AdminForm adminForm){
		Admin admin = new Admin();
		admin.setId(adminForm.getId());
		admin.setLogin(adminForm.getLogin());
		admin.setPassword(adminForm.getPassword());
		admin.setNom(adminForm.getName());
		admin.setPrenom(adminForm.getFirstName());
		admin.setLastConnexion(adminForm.getLastConnexion());
		
		return admin;
	}
}
